package com.team.sns.services.impl;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.team.sns.entities.UserRelation;
import com.team.sns.persistence.impl.JPAProvider;
import com.team.sns.services.UserFollowService;
@Service
@Transactional
public class UserFollowServiceImpl extends JPAProvider<UserRelation> implements UserFollowService{
	
	/**
	 * 关注
	 */
	public void save(UserRelation ur) {
	
		super.save(ur);
	}

	public List<Integer> getFollowUserIds(Integer userId) {
		String sql = "select userId from UserRelation where followId = ?1";
		List<Integer> lst = (List<Integer>)this.em.createQuery(sql);
		return lst;
	}
}
